﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Controls;

namespace Sparkle.UI
{
    public interface IControlFactory
    {
        Control CreateControl(Metadata metadata);
        TextBlock CreateLabel(Metadata metadata, double width);
        TextBlock CreateErrorControl(string errorMessage);

        event BindingHandler OnBinding;
        event CreateControlHandler OnControlCreate;
        event BindingHandler OnUnknownBinding;
        event CreateControlHandler OnUnknownControl;
        void SetBinding(Control control, Metadata metadata, object entity);

#if SILVERLIGHT
        DataGridColumn CreateColumn(Metadata metadata);
        void SetBinding(DataGridColumn column, Metadata metadata);
#else
        ColumnDefinition CreateColumn(Metadata metadata);
        void SetBinding(ColumnDefinition column, Metadata metadata);
#endif

    }
}
